﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GmModelFamily.h"
#include "DbDataSchema.h"
#include "IInstanceUpdateCustomProcessor.h"
#include "NdbObjectSchematic.h"

#define  BMVI_Left_Helper  L"BMVI_Left_Helper"  //与左右中心参照平面重合

namespace gcmp
{
    class IDocument;
    class IInstance;
}

namespace gfam
{
    class GCMP_MODEL_FAMILY_EXPORT Family2DUpdateCustomProcessorForConnectorData : public gcmp::NdbObjectSchematic, public gcmp::IInstanceUpdateCustomProcessor
    {
        CANNOT_COPY_OR_ASSIGN(Family2DUpdateCustomProcessorForConnectorData)
    public:
        DBOBJECT_DATA_BEGIN_AND_QUICK_CAST_FROM(gfam, Family2DUpdateCustomProcessorForConnectorData, gcmp::NdbObjectSchematic, 0F9E48BA - E2E3 - 4DE7 - B6F6 - 8C58BB588863, gcmpmodelfamily, IInstanceUpdateCustomProcessor)
            DBOBJECT_DATA_END

    public:
        /// \brief 析构函数
        virtual ~Family2DUpdateCustomProcessorForConnectorData() {}

    public:
        virtual bool PreProcess(const gcmp::IInstance *pInstance, gcmp::IFamilyInstanceUpdateEnvironment* pFamilyInstanceUpdateEnvironment) override;

        virtual bool PostProcess(gcmp::IInstance *pInstance, const gcmp::IFamilyInstanceUpdateResult* pFamilyInstanceUpdateResult) override;

        virtual NdbObject * GetTopOwnerObject() const override { return nullptr; }

    public:
        //读取二维连接点的坐标，保存到三维连接点中
        static bool Set3dCoordinatesBy2dCoordinatesNew(gcmp::IDocument* p3DFamilyDoc, gcmp::IInstance* pIInstance, const std::wstring& sModelViewUserDataId, const gcmp::Coordinate3d& workPlaneCoordinate);
    };
}